package xyz.eden.boot.common.web.support.infrastructure.publish.event;

import lombok.Getter;
import xyz.eden.boot.common.web.support.infrastructure.publish.enums.EventTypeEnum;

import java.util.Objects;

@Getter
public class ModelBatchChangeEvent extends ModelChangeEvent {


    public ModelBatchChangeEvent(Object source, EventTypeEnum type, Object before) {
        super(source, type, before);
    }

    /**
     * before plugin snapshot.
     *
     * @return snapshot
     */
    @Override
    public String beforeSnapshot() {
        return Objects.toString(getBefore(), "before plugin unknown");
    }

    /**
     * after plugin snapshot.
     *
     * @return snapshot
     */
    @Override
    public String afterSnapshot() {
        return Objects.toString(getAfter(), "after plugin unknown");
    }

    @Override
    public String eventName() {
        return "plugin";
    }
}
